﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<CRM.Database.Model.Customers>" %>
<%@ Import Namespace="CRM.Models" %>
<%@ Import Namespace="CRM.Resourses" %>

<% Html.DevExpress().GridView(settings =>
                                    {
                                        settings.Name = "gdCustomersProductSystems";
                                        settings.KeyFieldName = "IdProductSystem";
                                        settings.CallbackRouteValues = new { Controller = "Customers", Action = "ProductSystemsList", idCustomer = Model.IdCustomer };
                                        settings.SettingsPager.PageSize = 20;
                                        settings.Width = Unit.Percentage(100);

                                        //settings.Columns.Add(column =>
                                        //{
                                        //    column.Caption = Resourses.ProductSystemRu;
                                        //    column.FieldName = "ProductSystemRu";
                                        //});

                                        //settings.Columns.Add(column =>
                                        //{
                                        //    column.Caption = Resourses.ProductSystemDe;
                                        //    column.FieldName = "ProductSystemDe";
                                        //});

                                        //settings.Columns.Add(column =>
                                        //{
                                        //    column.Caption = Resourses.ProductSystemEn;
                                        //    column.FieldName = "ProductSystemEn";
                                        //});

                                        //settings.Columns.Add(column =>
                                        //{
                                        //    column.Caption = Resourses.ProductSystemSAP;
                                        //    column.FieldName = "ProductSystemSAP";
                                        //});

                                        settings.Columns.Add(column =>
                                        {
                                            column.Caption = Resourses.ProductSystem;
                                            column.FieldName = "ProductSystemNameLocalized";
                                            column.EditFormSettings.Visible = DefaultBoolean.False;
                                        });

                                        settings.Columns.Add(column =>
                                        {
                                            column.Caption = Resourses.ProductMark;
                                            column.FieldName = "ProductMarkExt";
                                            column.EditFormSettings.Visible = DefaultBoolean.False;
                                        });
                                        
                                        //settings.Columns.Add(column =>
                                        //{
                                        //    column.Caption = Resourses.ProductMark;
                                        //    column.FieldName = "IdProductMark";
                                        //    column.ColumnType = MVCxGridViewColumnType.ComboBox;
                                        //    var comboBoxProperties = column.PropertiesEdit as ComboBoxProperties;
                                        //    if (comboBoxProperties != null)
                                        //    {

                                        //        comboBoxProperties.DataSource = DB.ProductMarks;
                                        //        //collection.EquipmentTypes;
                                        //        comboBoxProperties.TextField = "ProductMark";
                                        //        comboBoxProperties.ValueField = "IdProductMark";
                                        //        comboBoxProperties.ValueType = typeof(int);
                                        //    }
                                        //});
                                        
                                    }).Bind((Model.ProductSystems)).GetHtml();%>